package thread;

public class ThreadIntDemo {
    public static void main(String[] args) {
        Thread main= Thread.currentThread();
        System.out.println(main);
        doSome();
    }
    public  static void doSome(){
        Thread t=Thread.currentThread();
        System.out.println("执行doSome方法的线程是"+t);
        String name=t.getName();//获取名字
        long id=t.getId();//获取id
        int priority=t.getPriority();//获取优先级
        System.out.println("name="+name+",id="+id+",优先级="+priority);

        boolean isDaemon= t.isDaemon();
        boolean isAlive=t.isAlive();
        boolean isInterrupted=t.isInterrupted();
        System.out.println("是否是守护线程="+isDaemon+",是否存活="+isAlive+",是否被中断="+isInterrupted);

    }
}
